{extend name="iframe" /}

{block name="body"}
<style>
    .money_table td{
        border: 1px solid #ccc;
        padding: 10px;
    }
</style>
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <form action="{:request()->url()}" method="post" class="" data-type="open">
        <div class="layui-form-item">
            <label class="layui-form-label">行业类型</label>
            <div class="layui-input-inline">
                <select name="parent_typeid" lay-filter="parent_typeid">
                    <option value="0">选择类型</option>
                    {foreach name="parent_typelist" item="vo"}
                    <option value="{$vo.id}" {if condition="$param.parent_typeid eq $vo.id"}selected{/if} >{$vo.title}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="typeid" id="typeid">
                    <option value="0">选择类型</option>
                    {foreach name="typelist" item="vo"}
                    <option value="{$vo.id}" {if condition="$param.typeid eq $vo.id"}selected{/if} >{$vo.title}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">项目</label>
            <div class="layui-input-block">
                <input type="text" name="project" placeholder="" autocomplete="off" class="layui-input" value="{$param.project}">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" lay-submit class="layui-btn">提交</button>
            </div>
        </div>
    </form>


    <div {if empty($data)}style="display: none;"{/if}>
        <div class="layui-form-item">
            <label class="layui-form-label">条件</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.tiaojian|raw}
                </blockquote>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">优势</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.youshi|raw}
                </blockquote>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">流程</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.liucheng|raw}
                </blockquote>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支持</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.zhichi|raw}
                </blockquote>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">加盟费</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.cost|raw}
                </blockquote>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">利润</label>
            <div class="layui-input-block">
                <blockquote class="layui-elem-quote layui-quote-nm">
                    {$data.profit|raw}
                </blockquote>
            </div>
        </div>
    </div>
    
</div>
{/block}
{block name="js"}
<script>
    var form = layui.form;
    form.on('select(parent_typeid)', function(res) { 
        $("#typeid").empty();
        if(res.value != 0){
            $.get("{:url('admin/DataType/getSonType')}?pid="+res.value,function(result){
                if(result.status){
                    $("#typeid").append(new Option('请选择',0));
                    $.each(result.data,function(index,item){
                        $("#typeid").append(new Option(item.title,item.id));
                    });
                    form.render("select");
                }
            });
        }else{
            $("#typeid").append(new Option('请选择',0));
            form.render("select");
        }
    })
</script>
{/block}